widget: Make the :has-focus property readonly
authorMatthias Clasen <mclasen@redhat.com>
Fri, 3 Apr 2020 00:51:31 +0000 (20:51 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 9 Apr 2020 21:50:29 +0000 (17:50 -0400)
The only place where this should be set is when making
a widget the focus-widget of a window. We still keep
the property around in readonly form, since there are
a few places where we rely on property notification
for it.

gtk/gtkwidget.c
gtk/inspector/css-editor.ui

index c9d65d04700571c8d1715632c974ee2c0b60551e..75155458e55100a5ec01d384ee7903add5d17824 100644 (file)
@@ -989,7 +989,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                             P_("Has focus"),
                             P_("Whether the widget has the input focus"),
                             FALSE,
-                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+                            GTK_PARAM_READABLE|G_PARAM_EXPLICIT_NOTIFY);
 
   widget_props[PROP_CAN_TARGET] =
       g_param_spec_boolean ("can-target",
@@ -1687,10 +1687,6 @@ gtk_widget_set_property (GObject         *object,
     case PROP_CAN_FOCUS:
       gtk_widget_set_can_focus (widget, g_value_get_boolean (value));
       break;
-    case PROP_HAS_FOCUS:
-      if (g_value_get_boolean (value))
-       gtk_widget_grab_focus (widget);
-      break;
     case PROP_CAN_TARGET:
       gtk_widget_set_can_target (widget, g_value_get_boolean (value));
       break;
index 15984bc28d33752022e6b3dbb47021ffb4de8f54..50b9bee503ed7cf2b2f048ef970e1ceea9944373 100644 (file)
@@ -55,7 +55,6 @@
             <property name="buffer">text</property>
             <property name="wrap-mode">word</property>
             <property name="monospace">1</property>
-            <property name="has-focus">1</property>
             <property name="left-margin">6</property>
             <property name="right-margin">6</property>
             <property name="has-tooltip">1</property>